package br.cesupa.fabsoft.nomedoprojeto.system.infra;

import java.util.Locale;

/**
 * Manage general configurations whicg affects the entire application.
 *
 * @author Breno Leite
 */
public class ApplicationConfigurationService {

    /**
     * Default {@link Locale} used when none is specified.
     */
    private static final Locale DEFAULT_APPLICATION_LOCALE =
            new Locale("pt", "BR");
    /**
     * The application current locale.
     */
    private Locale applicationLocale;

    /**
     * @return the current application {@link Locale}
     */
    public Locale getApplicationLocale() {
        Locale aux;
        if (applicationLocale == null) {
            aux = DEFAULT_APPLICATION_LOCALE;
        } else {
            aux = applicationLocale;
        }
        return aux;
    }

    /**
     * @param applicationLocale the {@link Locale} which the application must be
     * displayed
     */
    public void setApplicationLocale(final Locale applicationLocale) {
        this.applicationLocale = applicationLocale;
    }
}
